﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace EntityModel
{
    /// <summary>
    /// 成绩表
    /// </summary>
    [Table("C01")]
    public class EM_Score:EntityBase
    {

        /// <summary>
        /// 人员信息
        /// </summary>
        [Column("C000")]
        [Required]
        public ICollection<EM_Students> ?User { get; set; }

        /// <summary>
        /// 成绩
        /// </summary>
        [Column("C001")]
        [Required]
        public double Achievement { get; set; }

        /// <summary>
        /// 科目
        /// </summary>
        [Column("C002")]
        [StringLength(50)]
        [Required]
        public string? Subject { get; set; }

        /// <summary>
        /// 总成绩
        /// </summary>
        [Column("C003")]
        [Required]
        public double Total_Score { get; set; }

        /// <summary>
        /// 考试人数
        /// </summary>
        [Column("C004")]
        [Required]
        public double People { get; set; }

        /// <summary>
        /// 平均成绩
        /// </summary>
        [Column("C005")]
        [Required]
        public double Average_Score => this.Total_Score / this.People;
    }
}
